package com.wesley.imagecropper;

import java.io.File;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;


public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		findViewById(android.R.id.button1).setOnClickListener(new View.OnClickListener() {
					@Override
					public void onClick(View v) {
//						File file = new File(Environment
//								.getExternalStorageDirectory(),
//								"/DCIM/Camera/20130913_094929.jpg");
//						
//						Uri uri = Uri.fromFile(file);
						
						Uri uri = Uri.parse("http://e.hiphotos.baidu.com/album/w%3D2048/sign=a639b8bc4afbfbeddc59317f4cc8f636/267f9e2f07082838e3a6f597b999a9014d08f18e.jpg");
						
						Intent intent = new Intent(MainActivity.this,
								CropImage.class);
						intent.setDataAndType(uri, "image/*");
						startActivity(intent);

					}
		});
	}

}
